10 '###########################################################################
20 '#                                                                        ##
30 '#               TARGET: AN ARCADE-TYPE SHOOTING GAME                     ##
40 '#                               BY                                       ##
50 '#                         BRIAN D. MANN                                  ##
60 '#    628 ELGIN TERRACE, RICHMOND VA. 23225  (804) 320-4901               ##
70 '#    IF YOU DISCOVER ANY PROBLEMS WITH THIS CODE, OR HAVE ANY            ##
80 '#    QUESTIONS, PLEASE FEEL FREE TO CALL ME.                             ##
90 '#                                                                        ##
100 '#                                                                       ##
110 '# COPYRIGHT OCTOBER, 1982 BY BRIAN D. MANN. FOR NONPROFIT DISTRIBUTION  ##
120 '# ONLY. ALL RIGHTS RESERVED.                                            ##
130 '##########################################################################
140 R = INT(VAL(RIGHT$(TIME$,2))*544):RANDOMIZE(R)
150 DIM X(297):DIM Y(297)
160 KEY OFF
170 FOR I=1 TO 10:KEY I,"":NEXT:KEY 1,"RUN"+CHR$(13):KEY 2,"WIDTH 80"+CHR$(13)
180 SCREEN 1,0
190 CLS
200 WIDTH 40
210 LOCATE 12,17:PRINT "TARGET"
220 LOCATE 15,19: PRINT "by"
230 LOCATE 18,14:PRINT "BRIAN D. MANN"
240 LOCATE 24,10:PRINT "PRESS ANY KEY TO BEGIN"
250 A$=INKEY$:IF A$="" THEN 250
260 GOSUB 400
270 GOSUB 1290
280 GOSUB 950
290 CLS
300 LOCATE 10,20:PRINT "TARGET"
310 LOCATE 12,1:PRINT "DO YOU WISH EASY(3), MODERATE(4),                   HARD(5), OR IMPOSSIBLE(6)"
320 A$ = INKEY$:IF A$ = "" THEN 320
330 SPEED = VAL(A$)
340 SCREEN 1,0
350 LOOP = 0
360 HIT=0:MISS=0
370 DEF SEG
380 IF REPEAT = 1 THEN GOTO 530
390 GOTO 530
400 REM DRAW AND SAVE CROSSHAIRS (CRSHRS%)
410 LINE (5,4)-(5,25)
420 LINE (5,4)-(10,4)
430 LINE (5,25)-(10,25)
440 LINE (35,4)-(35,25)
450 LINE (30,4)-(35,4)
460 LINE (30,25)-(35,25)
470 CIRCLE (20,14),8
480 LINE (16,14)-(24,14)
490 LINE (20,10)-(20,18)
500 DIM CRSHRS%(150)
510 GET(0,0)-(35,25),CRSHRS%
520 RETURN
530 CLS' BEGINNING OF MAIN LOOP
540 FOR I = 1 TO 100
550 X=(RND(1)*318)+1:Y=(RND(1)*198)+1
560 PSET(X,Y)
570 NEXT
580 X1=140:Y1=80
590 POKE 106,0
600 YS=7:XS=10
610 P = 0
620 S1=INT(RND*170+1):S2=INT(RND*170)+1
630 IF X1<1 THEN X1=1
640 IF X1>280 THEN X1=280
650 IF Y1<1 THEN Y1=1
660 IF Y1>170 THEN Y1=170
670 PUT(X1,Y1),CRSHRS%,XOR
680 P =P+SPEED:IF   P >297 THEN 1130
690 X(P) = P
700 Y(P) = INT(((S2-S1)/297)*X(P))+S1
710 PUT (X(P),Y(P)),S%,XOR
720 FOR D1=1 TO 10:NEXT
730 POKE 160,0
740 A$=""
750 A$ = INKEY$: PUT(X(P),Y(P)),S%,XOR:IF LEN(A$) < 2 AND A$<> " " THEN 680 ELSE A =ASC(RIGHT$(A$,1))
760 IF A=32 THEN PUT(X1,Y1),CRSHRS%,XOR:GOTO 910
770 PUT(X1,Y1),CRSHRS%,XOR
780 ON A-70 GOSUB 800,810,820,830,840,850,860,870,880,890,900
790 GOTO 630
800 SOUND 100,1:X1=X1-XS:Y1=Y1-YS:RETURN
810 SOUND 125,1:Y1=Y1-YS:RETURN
820 SOUND 150,1:X1=X1+XS:Y1=Y1-YS:RETURN
830 RETURN
840 SOUND 200,1:X1=X1-XS:RETURN
850 RETURN
860 SOUND 200,1:X1=X1+XS:RETURN
870 RETURN
880 SOUND 300,1:X1=X1-XS:Y1=Y1+YS:RETURN
890 SOUND 325,1:Y1=Y1+YS:RETURN
900 SOUND 350,1:X1=X1+XS:Y1=Y1+YS:RETURN
910 SOUND 40,1:LINE (1,199)-(X1+16,Y1+10),3:LINE (319,199)-(X1+16,Y1+10),3:FOR W1=1 TO 3:NEXT
920 LINE (1,199)-(X1+16,Y1+10),0:LINE (319,199)-(X1+16,Y1+10),0:POKE 160,0
930 IF X1>X(P) -16  AND X1<X(P) -4  AND Y1 >Y(P) - 20 AND Y1 < Y(P)-6  THEN 940 ELSE 630
940 PUT (X1,Y1),E%,XOR:FOR I%=100 TO 1000 STEP 25:SOUND I%,1:NEXT:PUT (X1,Y1),E%,XOR:HIT=HIT+1:LOOP=LOOP+1:IF LOOP=5 THEN 1160 ELSE 580
950 DEF SEG
960 CLS
970 LOCATE 1,10:PRINT "YOUR ENEMY.":LOCATE 5,1:PRINT "YOUR MISSION: DESTROY HIM":PRINT
980 PRINT "USE THE KEY PAD TO MOVE YOUR SIGHTS"
990 PUT (120,60),CRSHRS%,PSET
1000 LOCATE 13,1:PRINT "ON TO THE ENEMY SHIP AND THEN PRESS":PRINT:PRINT"             THE SPACE BAR TO FIRE."
1010 PRINT
1020 PRINT "YOU WILL HAVE 5 CHANCES"
1030 PRINT:PRINT "PRESS ANY KEY TO BEGIN"
1040 REM DRAW AND SAVE SHIP (S%)
1050 CIRCLE (28,5),2
1060 LINE (26,6)-(20,5),,BF
1070 LINE (20,6)-(10,4),,BF
1080 LINE (13,6)-(15,9),,BF
1090 LINE (8,9)-(17,11),,BF
1100 DIM S%(150)
1110 GET (8,5)-(30,11),S%
1120 A$ = INKEY$:IF A$="" THEN 1120 ELSE RETURN
1130 PUT(X1,Y1),CRSHRS%,XOR
1140 SOUND 40,20
1150 LOOP =LOOP+1:IF LOOP=5 THEN 1160 ELSE 580
1160 REM **********END OF ROUND SUMMARY
1170 CLS: PRINT"YOU HIT ";HIT;" SHIPS OUT OF FIVE."
1180 PRINT:PRINT
1190 IF HIT<=2 THEN PRINT "YOU COULDN'T HIT THE BROAD SIDE OF A    VULCAN MOON!!
1200 IF HIT=3 THEN PRINT "WITH TRAINING, YOU MIGHT BE ABLE TO     CLEAN THE GUN!"
1210 IF HIT=4 THEN PRINT "WELL, NOT BAD BUT THE ONE THAT GOT AWAY JUST DESTROYED YOUR HOME PLANET!"
1220 IF HIT=5 THEN PRINT "GOOD SHOOTING!!! CAN YOU DO IT AGAIN?"
1230 PRINT:PRINT
1240 INPUT "DO YOU WISH TO PLAY AGAIN (Y/N)?";A$
1250 POKE 106,0
1260 IF A$ = "Y" OR A$ = "y" THEN GOTO 1280
1270 IF A$ = "N" OR A$ = "n" THEN END ELSE GOTO 1230
1280 REPEAT = 1: GOTO 290
1290 REM ############# EXPLOSION DRAW AND SAVE
1300 CLS
1310 DEF SEG
1320 DEFINT E
1330 DIM E%(130)
1340 'CLS
1350 OPEN "TARGET.PIC" FOR INPUT AS #1
1360 FOR Z = 0 TO 129
1370 INPUT#1, E%(Z)
1380 NEXT
1390 CLOSE
1400 RETURN
